import request from '@/utils/request'

export function getAllProductInfosByPageAndConditions(data) {
  return request({
    url: '/getAllProductInfosByPageAndConditions',
    method: 'get',
    params:data
  })
}

// 根据产品类型获取产品信息
export function getProductBriefInfosByTypeId(typeId) {
  return request({
    url: '/getProductBriefInfosByTypeId',
    method: 'get',
    params: typeId
  })
}

// 根据管理员编号获取产品类型获取产品信息
export function getProductInfosByManagerId(managerId) {
  return request({
    url: '/getProductInfosByManagerId',
    method: 'get',
    params: managerId
  })
}



export function addProductInfo(data) {
  return request({
    url: '/addProductInfo',
    method: 'post',
    data
  })
}

export function updateProductInfo(data) {
  return request({
    url: '/updateProductInfo',
    method: 'put',
    data
  })
}

export function deleteProductInfo(id) {
  return request({
    url: '/deleteProductInfo',
    method: 'delete',
    params:id
  })
}

export function uploadImg(data,info) {
  return request({
    url: '/uploadImage',
    method: 'post',
    data,
    params: info
  })
}


